package com.gwnet.shop.domain;

import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotNull;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * 订单对象 order_info
 * @author 张万鹏
 * @date 2024-07-29
 */
public class OrderInfo extends Model<OrderInfo> {
    private static final long serialVersionUID = 1L;

    /**  */
    @TableId
    @NotNull
    private String orderId;

    /** 商户 */
    private Long tenantId;

    /** 所属用户 */
    private Long userId;

    /** 学校id */
    private Long schoolId;

    /** 用户名 */
    private String userName;

    /** 配送id */
    private String deliveryId;

    /** 打包费用 */
    private Double totalPackageMoney;

    /** 配送费用 */
    private Double deliverAmount;

    /** 商品金额 */
    private Double goodsAmount;


    private Double orderAmount;

    /** 订单状态(0待付款 1待接单 2待到店 3待取货 4待送达 5 待收货 6 完成 7取消(客户)8作废(管理员))9已退款 */
    private String orderStatus;

    /** 用户留言 */
    private String postscript;

    /** 下单时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date addTime;

    /** 完成时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date completeTime;

    /** 设备ID */
    private String devSn;

    /** 箱门编号 */
    private Integer boxNo;

    /** 取餐号 */
    private String foodDeliveryCode;

    /** 是否结算 */
    private Integer isSettled;

    /** 创建者 */
    private String createBy;

    /** 创建者姓名 */
    private String createName;

    /** 创建时间 */
    private Date createTime;

    /** 更新者 */
    private String updateBy;

    /** 更新者姓名 */
    private String updateName;

    /** 更新时间 */
    private Date updateTime;

    /** 备注 */
    private String remark;

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getCreateName() {
        return createName;
    }

    public void setCreateName(String createName) {
        this.createName = createName;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getUpdateName() {
        return updateName;
    }

    public void setUpdateName(String updateName) {
        this.updateName = updateName;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public void setOrderId(String orderId)
    {
        this.orderId = orderId;
    }

    public String getOrderId()
    {
        return orderId;
    }


    public Long getTenantId() {
        return tenantId;
    }

    public void setTenantId(Long tenantId) {
        this.tenantId = tenantId;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }

    public void setUserName(String userName)
    {
        this.userName = userName;
    }

    public String getUserName()
    {
        return userName;
    }
    public void setDeliveryId(String deliveryId)
    {
        this.deliveryId = deliveryId;
    }

    public String getDeliveryId()
    {
        return deliveryId;
    }

    public Double getTotalPackageMoney() {
        return totalPackageMoney;
    }

    public void setTotalPackageMoney(Double totalPackageMoney) {
        this.totalPackageMoney = totalPackageMoney;
    }

    public Double getDeliverAmount() {
        return deliverAmount;
    }

    public void setDeliverAmount(Double deliverAmount) {
        this.deliverAmount = deliverAmount;
    }

    public Double getGoodsAmount() {
        return goodsAmount;
    }

    public void setGoodsAmount(Double goodsAmount) {
        this.goodsAmount = goodsAmount;
    }

    public Double getOrderAmount() {
        return orderAmount;
    }

    public void setOrderAmount(Double orderAmount) {
        this.orderAmount = orderAmount;
    }

    public void setOrderStatus(String orderStatus)
    {
        this.orderStatus = orderStatus;
    }

    public String getOrderStatus()
    {
        return orderStatus;
    }
    public void setPostscript(String postscript)
    {
        this.postscript = postscript;
    }

    public String getPostscript()
    {
        return postscript;
    }
    public void setAddTime(Date addTime)
    {
        this.addTime = addTime;
    }

    public Date getAddTime()
    {
        return addTime;
    }
    public void setCompleteTime(Date completeTime)
    {
        this.completeTime = completeTime;
    }

    public Date getCompleteTime()
    {
        return completeTime;
    }
    public void setFoodDeliveryCode(String foodDeliveryCode)
    {
        this.foodDeliveryCode = foodDeliveryCode;
    }

    public String getFoodDeliveryCode()
    {
        return foodDeliveryCode;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("orderId", getOrderId())
            .append("tenantId", getTenantId())
            .append("userId", getUserId())
            .append("userName", getUserName())
            .append("deliveryId", getDeliveryId())
            .append("orderAmount", getOrderAmount())
            .append("orderStatus", getOrderStatus())
            .append("postscript", getPostscript())
            .append("remark", getRemark())
            .append("addTime", getAddTime())
            .append("completeTime", getCompleteTime())
            .append("foodDeliveryCode", getFoodDeliveryCode())
            .toString();
    }


    /**
     * 订单对应购买的商品
     */
    @TableField(exist = false)
    private List<OrderGoods> goods;

    /**
     * 配送信息
     */
    @TableField(exist = false)
    private List<OrderDelivery> orderDelivery;

    /**
     * 支付信息
     */
    @TableField(exist = false)
    private List<OrderPayment> orderPayment;


    public List<OrderGoods> getGoods() {
        return goods;
    }

    public void setGoods(List<OrderGoods> goods) {
        this.goods = goods;
    }

    public List<OrderDelivery> getOrderDelivery() {
        return orderDelivery;
    }

    public void setOrderDelivery(List<OrderDelivery> orderDelivery) {
        this.orderDelivery = orderDelivery;
    }

    public List<OrderPayment> getOrderPayment() {
        return orderPayment;
    }

    public void setOrderPayment(List<OrderPayment> orderPayment) {
        this.orderPayment = orderPayment;
    }

    public String getDevSn() {
        return devSn;
    }

    public void setDevSn(String devSn) {
        this.devSn = devSn;
    }


    public Integer getBoxNo() {
        return boxNo;
    }

    public void setBoxNo(Integer boxNo) {
        this.boxNo = boxNo;
    }

    public Integer getIsSettled() {
        return isSettled;
    }

    public void setIsSettled(Integer isSettled) {
        this.isSettled = isSettled;
    }
}
